package com.itheima.d1_num1;

public class RedFujiApple extends  Fruit{
    private  String name;
    private String origin;
    private double price;

    public RedFujiApple() {
       this("红富士苹果","中国",20.0);
    }
    @Override
    public void bePicked() {
        System.out.println("产地为" + origin + "的" + name+"被采摘了");
    }
    @Override
    public void bearFruit() {
        System.out.println("产地为" + origin + "的" + name+"已经结果");
    }
    @Override
    public void bloom() {
        System.out.println("产地为" + origin + "的" + name+"已经开花");
    }






    public RedFujiApple(String name, String origin, double price) {
        this.name = name;
        this.origin = origin;
        this.price = price;
    }

    /**
     * 获取
     * @return origin
     */
    public String getOrigin() {
        return origin;
    }

    /**
     * 设置
     * @param origin
     */
    public void setOrigin(String origin) {
        this.origin = origin;
    }

    /**
     * 获取
     * @return price
     */
    public double getPrice() {
        return price;
    }

    /**
     * 设置
     * @param price
     */
    public void setPrice(double price) {
        this.price = price;
    }

    public String toString() {
        return "RedFujiApple{name = " + name + ", origin = " + origin + ", price = " + price + "}";
    }
}
